package com.cheetah.start.module.system.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cheetah.start.common.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Objects;


/**
 * 角色菜单实体
 *
 * @author Feel
 * @date 2021/09/05
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "sys_role_menu")
public class SysRoleMenu extends BaseEntity {

    @TableId(value = "role_menu_id")
    private Integer roleMenuId;

    private Integer roleId;

    private Integer menuId;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof SysRoleMenu)) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        SysRoleMenu roleMenu = (SysRoleMenu) o;
        return getRoleId().equals(roleMenu.getRoleId()) &&
                getMenuId().equals(roleMenu.getMenuId());
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), getRoleId(), getMenuId());
    }
}
